package com.financial.transactionhistory.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.financial.common.annotation.Excel;
import com.financial.common.core.domain.BaseEntity;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 交易记录对象 financial_transaction
 *
 * @author chenda
 * @date 2025-06-15
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("交易记录实体")
public class FinancialTransaction extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 交易ID */
    @ApiModelProperty(value = "主键ID")
    private Long id;
    /** 用户ID */
    @Excel(name = "用户ID")
    @ApiModelProperty(value = "用户ID")
    private Long userId;
    /** 交易金额 */
    @Excel(name = "交易金额")
    @ApiModelProperty(value = "交易金额")
    private BigDecimal amount;
    /** 类型（1收入 2支出） */
    @Excel(name = "类型", readConverterExp = "1=收入,2=支出")
    @ApiModelProperty(value = "类型")
    private Integer type;
    /** 分类（如餐饮、工资等） */
    @Excel(name = "分类", readConverterExp = "如=餐饮、工资等")
    @ApiModelProperty(value = "分类")
    private String category;
    /** 交易描述 */
    @Excel(name = "交易描述")
    @ApiModelProperty(value = "交易描述")
    private String description;
    /** 交易发生时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "交易发生时间", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "交易发生时间")
    private LocalDate transactionTime;
    /** 删除标志 */
    @ApiModelProperty(value = "交易发生时间")
    private String delFlag;
}